<template>
  <div class="wrap">
    <el-table v-loading="loading" :data="customerList" style="width: 100%">
      <el-table-column label="姓名" align="center" prop="name" show-overflow-tooltip>
        <template slot-scope="{ row }">
          <span style="color: #082aff"> {{ row.name }}</span>
        </template>
      </el-table-column>
      <el-table-column label="手机" prop="phone" show-overflow-tooltip></el-table-column>
      <el-table-column label="邮箱" align="center" prop="email" show-overflow-tooltip/>
      <el-table-column label="微信号" align="center" prop="wxAccount" show-overflow-tooltip>
      </el-table-column>
      <el-table-column label="微信名称" align="center" prop="wxName" show-overflow-tooltip></el-table-column>
      <el-table-column label="性别" align="center" prop="gender" show-overflow-tooltip>
        <template slot-scope="{ row }">
          <div v-for="item in userSex" :key="item.dictValue">
            <span v-if="row.gender === item.dictValue">{{
                item.dictLabel
              }}</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="标签" align="center" prop="tag" show-overflow-tooltip>
      </el-table-column>
      <el-table-column label="跟进阶段" align="center" prop="followStatus" show-overflow-tooltip>
        <template slot-scope="{ row }">
          <div v-for="item in followStatusList" :key="item.dictValue">
            <span v-if="row.followStatus === item.dictValue">{{ item.dictLabel }}</span>
          </div>
        </template>
      </el-table-column>
      <el-table-column v-if="!isShowDelBtn" label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="deletes(scope)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- <NormalPagination :currentPage="pageNum" :pageSize="pageSize" :total="total" @handleSizeChange="handleSizeChange" @handleCurrentChange="handleCurrentChange"></NormalPagination> -->
  </div>
</template>

<script>
export default {
  name: "customerTableDel",
  props: {
    userSex: Array,
    customerList: Array,  // 父级页面已有的客户数据
    followStatusList: Array,
    isShowDelBtn: Boolean
  },
  watch: {
    customerList: {
      handler(data) {
        localStorage.setItem("tableList", JSON.stringify(data));
        this.customerLists = data;
        this.total = this.$props.customerList.length;
      },
    },
  },
  data() {
    return {
      customerName: "",
      followStatus: "",
      loading: false,
      pageNum: 1,
      pageSize: 10,
      total: 0,
      customerLists: null,
      allcustomerList: null,
    };
  },
  methods: {
    // 删除
    deletes(scope) {
      this.$emit("deletes", scope.$index);
    },
    // handleSizeChange(val) {
    //   this.pageNum = 1;
    //   this.pageSize = val;
    // },
    // handleCurrentChange(val) {
    //   this.pageNum = val;
    // },
  },
};
</script>


<style lang="scss" scoped>
@import "../../../../styles/base.scss";
.wrap {
  margin-top: 10px;
}
</style>
